<?php


if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
if(!defined('Adz_class')){include('Adz.class.php');}

if($_POST){
	$save = $_POST['save'];
	if($save['rid'])
	Adz::mysql_save('plugin_push_bind',array('mail'=>$save['mail']),array('rid' =>$save['rid']));
	if($save['mail']==1){
		$msg = '修改成功，每次回复都会有邮件提醒';
		$status = 1;
	}elseif($save['mail']==2){
		$msg = '修改成功，每日只有一次邮件提醒';
		$status = 1;
	}elseif($save['mail']==3){
		$msg = '修改成功，每周只有一次邮件提醒';
		$status = 1;
	}else{
		$msg = '邮件推送已关闭';
		$status = 0;
	}
	header('Content-type: application/json; charset=UTF-8');
	echo json_encode(array('msg'=>$msg,'status'=>$status));
}
?>